<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let arr = [1, 2, 3];
    /*let a = arr[0];
    let b = arr[1];
    let c = arr[2];
    console.log(a,b,c);*/

    let [a, b, c] = arr;   // 结构表达式  （数组）
    console.log(a, b, c);
</script>

<script>
    const person = {
        name: "jack",
        age: 21,
        language: ['java', 'js', 'go', 'kotlin', 'python']
    };
    const {name: marry, age, language} = person;
    console.log(marry, age, language);
</script>

<script>
    // 字符串扩展
    let str = "hello.vue";
    console.log(str.startsWith("hello"));  // true
    console.log(str.endsWith(".vue"));  // true
    console.log(str.includes("e"));  // true
    console.log(str.includes("hello"));  // true

    // 字符串模板  注意使用特殊的单引号
    let ss = `<div>
                <span>hello,world</span>
              </div>`;
    console.log(ss);

    // 引用之前的变量，使用表达式，方法
    let info = `我是${marry},今年${age + 5}了`;
    console.log(info);

    function f1() {
        return "祝神舟12号发射成功";
    }

    let info2 = `我是${marry},今年${age - 5}了,我想说:${f1()}`;
    console.log(info2);
</script>
</body>
</html>